package doantotnghiep.business;

import java.util.ArrayList;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;

import doantotnghiep.dao.PurchaseOrdeDao;
import doantotnghiep.model.Customer;
import doantotnghiep.model.PurchaseOrder;
import doantotnghiep.model.PurchaseOrderDetail;

public class PurchaseOrderBusiness {

	@Autowired
	private PurchaseOrdeDao purchaseOrdeDao;

	public void addPurchase(PurchaseOrder purchaseOrder) {
		purchaseOrdeDao.addPurchase(purchaseOrder);
	}

	public List<Customer> getAllCustomer() {
		return purchaseOrdeDao.getAllCustomer();
	}

	public List<PurchaseOrder> getAllPurchase() {
		return purchaseOrdeDao.getAllPurchase();
	}

	public void deletePurchase(int id) {
		purchaseOrdeDao.deletePurchase(id);
	}

	public int getCurrentPurchase() {
		return purchaseOrdeDao.getCurrentPurchaseID();
	}

	public void addOrderDetail(PurchaseOrderDetail purchaseOrderDetail) {
		purchaseOrdeDao.addOrderDetail(purchaseOrderDetail);
	}

	public List<PurchaseOrderDetail> getAllOrderDetailByID(int id) {
		return purchaseOrdeDao.getAllOrderDetailByID(id);
	}

	public void deleteOrderDetail(int id) {
		purchaseOrdeDao.deleteOrderDetail(id);

	}

	public ArrayList<PurchaseOrderDetail> getOrderDetailByID(int id) {
		return purchaseOrdeDao.getListOrderDetailByID(id);
	}

	public List<PurchaseOrder> getAllPurchaseNotExported(String date) {
		return purchaseOrdeDao.getAllPurchaseNotExported(date);
	}

	public List<PurchaseOrder> getAllPurchaseByOrderDate(String orderDate) {
		return purchaseOrdeDao.getAllPurchaseByOrderDate(orderDate);
	}

}
